#include <iostream>
#include <cstring>

#include "workermi.h"

const int SIZE = 5;

using std::cin;
using std::cout;
using std::endl;
using std::strchr;

int main113() {

    Worker * lolas[SIZE];

    int ct;
    for(ct = 0; ct < SIZE; ct++) {

        char choice;
        cout << "Enter the employee category:\n"
            << "w: Waiter\ts: singer"
            <<"\nt: singer waiter\t q: quit\n";
        cin >> choice;
        while( strchr("wstq", choice) == NULL) {
            cout << "Please enter a w, s, t, or q: ";
            cin >> choice;
        }
        if(choice == 'q') {
            break;
        }
        switch(choice) {
            case 'w' : 
                lolas[ct] = new Waiter;
                break;
            case 's' :
                lolas[ct] = new Singer;
                break;
            case 't':
                lolas[ct] = new SingingWaiter;
                break;
        }

        cin.get();
        lolas[ct]->set();
    }

    cout << "\nHere is your staff:\n";
    int i;
    for(i=0; i<ct; i++) {
        cout << endl;
        lolas[i]->show();
    }
    for(i=0; i<ct; i++) {
        delete lolas[i];
    }
    cout << "bye.\n";
    return 0;
}
